<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>文章</title>
    <link rel="stylesheet" th:href="@{/mdeditor/css/style.css}"/>
    <link rel="stylesheet" th:href="@{/mdeditor/css/editormd.css}"/>
    <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon"/>
</head>
<body>

<div id="layout">
    <header>
        <h1 th:text="${article.blogTitle}"></h1>
        <h2 th:text="${article.blogPreface}"></h2>
    </header>
    <div id="test-editormd">
        <textarea style="display:none;" th:text="${article.blogContent}"></textarea>
    </div>
</div>

<!--一个JS文件都不能少，少一个便无法渲染。注意静态资源路径问题-->
<script th:src="@{/mdeditor/js/jquery.min.js}"></script>
<script th:src="@{/mdeditor/lib/marked.min.js}"></script>
<script th:src="@{/mdeditor/lib/prettify.min.js}"></script>
<script th:src="@{/mdeditor/lib/raphael.min.js}"></script>
<script th:src="@{/mdeditor/lib/underscore.min.js}"></script>
<script th:src="@{/mdeditor/lib/sequence-diagram.min.js}"></script>
<script th:src="@{/mdeditor/lib/flowchart.min.js}"></script>
<script th:src="@{/mdeditor/lib/jquery.flowchart.min.js}"></script>
<script th:src="@{/mdeditor/js/editormd.min.js}"></script>
<script type="text/javascript">

    var testEditor;

    $(function () {
        testEditor = editormd.markdownToHTML("test-editormd", {
            width: "90%",
            height: 700,
            path: "/mdeditor/lib/",
            preview: true,
            watch: true,
            editor: false,
        })
    })

</script>
</body>
</html>
